import React from 'react'
import { RouteObject } from '../interface'
import lazyLoad from '../LazyLoad'

export default [
  {
    path: '/lazy',
    element: lazyLoad(React.lazy(() => import('@/views/demo/Lazy'))),
    meta: {
      title: '异步导入'
    },
    children: [
      {
        path: 'xxx',
        element: lazyLoad(React.lazy(() => import('@/views/demo/Children'))),
        meta: {
          title: '子路由'
        },
        children: [
          {
            index: true,
            element: lazyLoad(React.lazy(() => import('@/views/demo/Children'))),
            meta: {
              title: '子路由'
            }
          },
          {
            path: 'auth',
            element: lazyLoad(React.lazy(() => import('@/views/demo/Children'))),
            meta: {
              title: '子路由',
              requiresAuth: true
            }
          }
        ]
      },
      {
        path: 'auth',
        element: lazyLoad(React.lazy(() => import('@/views/demo/Auth'))),
        meta: {
          title: '需要权限的子路由',
          requiresAuth: true
        }
      }
    ]
  },

  {
    path: 'b',
    element: lazyLoad(React.lazy(() => import('@/views/demo/Auth'))),
    meta: {
      title: 'b'
    }
  }
] as RouteObject[]
